package com.nf;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test {
    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        男同学 n1 = (男同学)ac.getBean("n1");
        System.out.println(  n1.getName() );
        System.out.println(  n1.getAge() );
        System.out.println(  n1.get老婆() );
        女人 a = n1.get老婆();
        a.sing();

        System.out.println(  n1.get情人());
    }
}
